﻿using System;
using System.Collections.Generic;
using Assets.Scripts.GtsScripts;
using MoonSharp.Interpreter;
using UnityEngine;

namespace Lua
{
	// Token: 0x020002E9 RID: 745
	[MoonSharpUserData]
	public class Animation
	{
		// Token: 0x0600114B RID: 4427 RVA: 0x0007F523 File Offset: 0x0007D723
		[MoonSharpHidden]
		public Animation(EntityBase e)
		{
			if (e == null)
			{
				Debug.LogError("Creating Animation with no entity");
			}
			this.entity = e;
			this.animation = e.animationManager;
		}

		// Token: 0x17000270 RID: 624
		// (get) Token: 0x0600114C RID: 4428 RVA: 0x0007F554 File Offset: 0x0007D754
		// (set) Token: 0x0600114D RID: 4429 RVA: 0x0007F561 File Offset: 0x0007D761
		public float minSpeed
		{
			get
			{
				return this.animation.minSpeed;
			}
			set
			{
				this.animation.minSpeed = value;
			}
		}

		// Token: 0x17000271 RID: 625
		// (get) Token: 0x0600114E RID: 4430 RVA: 0x0007F56F File Offset: 0x0007D76F
		// (set) Token: 0x0600114F RID: 4431 RVA: 0x0007F57C File Offset: 0x0007D77C
		public float maxSpeed
		{
			get
			{
				return this.animation.maxSpeed;
			}
			set
			{
				this.animation.maxSpeed = value;
			}
		}

		// Token: 0x17000272 RID: 626
		// (get) Token: 0x06001150 RID: 4432 RVA: 0x0007F58A File Offset: 0x0007D78A
		// (set) Token: 0x06001151 RID: 4433 RVA: 0x0007F597 File Offset: 0x0007D797
		public float transitionDuration
		{
			get
			{
				return this.animation.transitionDuration;
			}
			set
			{
				this.animation.transitionDuration = value;
			}
		}

		// Token: 0x17000273 RID: 627
		// (get) Token: 0x06001152 RID: 4434 RVA: 0x0007F5A5 File Offset: 0x0007D7A5
		public float speedMultiplier
		{
			get
			{
				return this.animation.speedMultiplier;
			}
		}

		// Token: 0x06001153 RID: 4435 RVA: 0x0007F5B4 File Offset: 0x0007D7B4
		public void Set(string animationName)
		{
			if (this.entity.actionManager != null)
			{
				this.entity.actionManager.ScheduleAction(new AnimationAction(animationName, true, false));
			}
			else
			{
				this.animation.PlayAnimation(animationName, false, false);
			}
		}

		// Token: 0x06001154 RID: 4436 RVA: 0x0007F604 File Offset: 0x0007D804
		public void SetAndWait(string animationName)
		{
			if (this.entity.actionManager != null)
			{
				this.entity.actionManager.ScheduleAction(new AnimationAction(animationName, true, true));
			}
			Giantess component = this.entity.GetComponent<Giantess>();
			if (component != null)
			{
				component.GtsMovement.doNotMoveGts = true;
			}
		}

		// Token: 0x06001155 RID: 4437 RVA: 0x0007F663 File Offset: 0x0007D863
		public string Get()
		{
			return this.animation.nameAnimation;
		}

		// Token: 0x06001156 RID: 4438 RVA: 0x0007F670 File Offset: 0x0007D870
		public void SetPose(string poseName)
		{
			if (this.entity.actionManager != null)
			{
				this.entity.actionManager.ScheduleAction(new PoseAction(poseName));
			}
			else
			{
				this.animation.PlayAnimation(poseName, true, false);
			}
		}

		// Token: 0x06001157 RID: 4439 RVA: 0x0007F6BC File Offset: 0x0007D8BC
		public float GetSpeed()
		{
			return this.animation.GetCurrentSpeed();
		}

		// Token: 0x06001158 RID: 4440 RVA: 0x0007F6C9 File Offset: 0x0007D8C9
		public void SetSpeed(float speed)
		{
			this.animation.ChangeSpeed(speed);
		}

		// Token: 0x06001159 RID: 4441 RVA: 0x0007F6D7 File Offset: 0x0007D8D7
		public float GetTime()
		{
			return this.animation.GetAnimationTime();
		}

		// Token: 0x0600115A RID: 4442 RVA: 0x0007F6E4 File Offset: 0x0007D8E4
		public float GetLength()
		{
			return this.animation.GetAnimationLength();
		}

		// Token: 0x0600115B RID: 4443 RVA: 0x0007F6F1 File Offset: 0x0007D8F1
		public float GetProgress()
		{
			return this.animation.GetAnimationProgress();
		}

		// Token: 0x0600115C RID: 4444 RVA: 0x0007F6FE File Offset: 0x0007D8FE
		public bool IsCompleted()
		{
			return this.animation.AnimationHasFinished();
		}

		// Token: 0x0600115D RID: 4445 RVA: 0x0007F70B File Offset: 0x0007D90B
		public bool IsInTransition()
		{
			return !this.animation.TransitionEnded();
		}

		// Token: 0x0600115E RID: 4446 RVA: 0x0007F71B File Offset: 0x0007D91B
		public bool IsInPose()
		{
			return this.animation.IsInPose();
		}

		// Token: 0x0600115F RID: 4447 RVA: 0x0007F728 File Offset: 0x0007D928
		public static bool AnimationExists(string animationName)
		{
			return AnimationManager.AnimationExists(animationName);
		}

		// Token: 0x06001160 RID: 4448 RVA: 0x0007F730 File Offset: 0x0007D930
		public static IList<string> GetAnimationList()
		{
			return IOManager.Instance.GetAnimationList();
		}

		// Token: 0x06001161 RID: 4449 RVA: 0x0007F73C File Offset: 0x0007D93C
		public static bool PoseExists(string poseName)
		{
			return IOManager.Instance.posesList.Contains(poseName);
		}

		// Token: 0x06001162 RID: 4450 RVA: 0x0007F74E File Offset: 0x0007D94E
		public static IList<string> GetPoseList()
		{
			return IOManager.Instance.posesList;
		}

		// Token: 0x06001163 RID: 4451 RVA: 0x0007F75A File Offset: 0x0007D95A
		public static void SetGlobalSpeed(float speed)
		{
			GameController.ChangeSpeed(speed);
		}

		// Token: 0x06001164 RID: 4452 RVA: 0x0007F75A File Offset: 0x0007D95A
		public static void GetGlobalSpeed(float speed)
		{
			GameController.ChangeSpeed(speed);
		}

		// Token: 0x040016B2 RID: 5810
		private EntityBase entity;

		// Token: 0x040016B3 RID: 5811
		private AnimationManager animation;
	}
}
